var tabsPanel;

function getTabsPanel()
{
	tabsPanel=Ext.create('Ext.tab.Panel', 
    {
        region: 'center', // a center region is ALWAYS required for border layout
        xtype: 'basic-tabs',
        plain: true,
        style: 'background:#fff; padding:5px 0px 0px 0px;',
        frame:false,
        activeTab: 0,     // first tab initially active
        items: 
        	[{
				
        		xtype:'panel',
        		title: 'Starting page',
        		closable: true,
        		autoScroll: true,
        		layout:'border',
        	    html: '<iframe src="startingPage.jsp" width="100%" height="99%" frameBorder="0"></iframe>'
        	}]
    });
	
	return tabsPanel;
}

function addTab(id,title,url)
{
	var i=0;
	for (i=0;i<tabsPanel.items.length;i++)
	{
		var tab=tabsPanel.items.get(i);
		if (tab.id==id)
		{
			tabsPanel.setActiveTab(tab);
			return;
		}
	}
	
	tabsPanel.add(
	{
		id:id,
		xtype:'panel',
		title: title,
		closable: true,
		autoScroll: true,
		layout:'border',
	    html: '<iframe src="'+url+'" width="100%" height="99%" frameBorder="0"></iframe>'
	});
	
	tabsPanel.setActiveTab(tabsPanel.items.length-1);
}